-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/2.2.1 #66
Feat/2.2.1 #66
Conversation
configs.py
Outdated
value = network_config.get('feeds', {}).get(caption, {}).get(param, None) | ||
if value is None: | ||
value = config['conditions'].get(caption, {}).get(param, None) | ||
if value is None: | ||
value = config['conditions']['default'].get(param, None) | ||
if value is None: | ||
value = default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use the or
operator to make this more concise and readable.
value = network_config.get('feeds', {}).get(caption, {}).get(param, None) | |
if value is None: | |
value = config['conditions'].get(caption, {}).get(param, None) | |
if value is None: | |
value = config['conditions']['default'].get(param, None) | |
if value is None: | |
value = default | |
value = (network_config.get('feeds', {}).get(caption, {}).get(param, None) | |
or config['conditions'].get(caption, {}).get(param, None) | |
or config['conditions']['default'].get(param, default)) |
price_feeds_poller.py
Outdated
"secs": [] | ||
}) | ||
print(f" => ID4 : {pf_id}") | ||
if routed == True: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we modifying the routed
value? if not, this if
statement seems unnecessary
price_feeds_poller.py
Outdated
for index in range(len(supports[0])): | ||
caption = supports[1][index] | ||
pf_id = supports[0][index].hex() | ||
rad_hash = supports[2][index].hex() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use zip
here.
for index in range(len(supports[0])): | |
caption = supports[1][index] | |
pf_id = supports[0][index].hex() | |
rad_hash = supports[2][index].hex() | |
for (pf_id_bytes, caption_bytes, rad_hash_bytes) in zip(*supports): | |
caption = caption_bytes.decode() | |
pf_id = pf_id_bytes.hex() | |
rad_hash = rad_hash_bytes.hex() |
No description provided.